package net.zabuchy.customer.entity;

import java.io.Serializable;

import org.hibernate.annotations.GenericGenerator;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.hibernate.annotations.Parameter;



/**
 * The persistent class for the licence_details database table.
 * 
 */
@Entity
@Table(name="licence_details")
public class LicenceDetail implements Serializable {
	
	private static final long serialVersionUID = 1L;
	
	private int customerId;
	private Date licenceExpired;
	private Date licenceGained;
	private int licenceNr;
	private int projectsLimit;
	private int usersLimit;
	private Customer customer;

    public LicenceDetail() {
    }


	@GenericGenerator(name = "generator", strategy = "foreign", parameters = @Parameter(name = "property", value = "customer"))
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "CUSTOMER_ID", unique = true, nullable = false)
	public int getCustomerId() {
		return this.customerId;
	}

	public void setCustomerId(int customerId) {
		this.customerId = customerId;
	}


    @Temporal( TemporalType.TIMESTAMP)
	@Column(name="LICENCE_EXPIRED")
	public Date getLicenceExpired() {
		return this.licenceExpired;
	}

	public void setLicenceExpired(Date licenceExpired) {
		this.licenceExpired = licenceExpired;
	}


    @Temporal( TemporalType.TIMESTAMP)
	@Column(name="LICENCE_GAINED")
	public Date getLicenceGained() {
		return this.licenceGained;
	}

	public void setLicenceGained(Date licenceGained) {
		this.licenceGained = licenceGained;
	}


	@Column(name="LICENCE_NR")
	public int getLicenceNr() {
		return this.licenceNr;
	}

	public void setLicenceNr(int licenceNr) {
		this.licenceNr = licenceNr;
	}


	@Column(name="PROJECTS_LIMIT")
	public int getProjectsLimit() {
		return this.projectsLimit;
	}

	public void setProjectsLimit(int projectsLimit) {
		this.projectsLimit = projectsLimit;
	}


	@Column(name="USERS_LIMIT")
	public int getUsersLimit() {
		return this.usersLimit;
	}

	public void setUsersLimit(int usersLimit) {
		this.usersLimit = usersLimit;
	}


	@OneToOne(fetch = FetchType.LAZY)
	@PrimaryKeyJoinColumn
	public Customer getCustomer() {
		return this.customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}
	
}